<?php
class FeedbookAction extends HomeAction {

    public function index(){ 
        $obj = M('Feedbook');
        $map['memberID'] = $this->_user['memberID'];
        $count = $obj->where($map)->count();
        import("@.ORG.WapPage");
        $page = new Page($count, 10);
        $show = $page->show();
        $list = $obj->where($map)->order('id desc')->limit($page->firstRow . ',' . $page->listRows)->select();
        $this->assign('list', $list);
        $this->assign('page', $show);
        $this->display();      
    }

    public function add(){
        $map['memberID'] = $this->_user['memberID'];
        $address = M('Address')->where($map)->order('def desc , id desc')->find();
        $this->assign('address',$address);
        $this->display();
    }

    public function save(){
        $this->all_add('Feedbook',U('Feedbook/index'));     
    }  

}